package com.yumeko.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import javax.annotation.Resource;

/**
 * @program: cloud-consumer-order90
 * @description:
 * @author: Zheng Hao
 * @create: 2020-03-17 20:49
 */
@RestController
public class OrderController {

    @Value("${service-url.nacos-user-service}")
    public String serverUrl;

    @Resource
    public RestTemplate restTemplate;


    @GetMapping("/consumer/payment/info")
    public String ConsumerPaymentInfo() {
        return restTemplate.getForObject(serverUrl + "/payment/info", String.class);
    }
}
